package com.sora.sora.security.login.model.param;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;

/**
 * 注册参数
 *
 * @author sora
 * @date 2021/07/23
 */
@Data
public class RegisterParam {

    /**
     * 昵称
     */
    @NotBlank(message = "用户名不能为空")
    @Length(min = 1, max = 10, message = "用户名长度为1-10个字符")
    private String name;

    /**
     * 密码
     */
    @NotBlank(message = "密码不能为空")
    @Length(min = 8, max = 16, message = "密码长度在8-16之间")
    private String password;

    /**
     * 电子邮件
     */
    @NotBlank(message = "邮箱不能为空")
    @Email
    private String email;

    @NotBlank(message = "验证码不能为空", groups = Normal.class)
    private String verifyCode;

    public interface Normal {}
}
